{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<load href='__TMPL__Common/js/mail_index.js' />
<div class="main">
<div class="main_title">{%EDIT} <a href="{:u("PromoteMsg/mail_index")}" class="back_list">{%BACK_LIST}</a></div>
<div class="blank5"></div>
<form name="edit" action="__APP__" method="post" enctype="multipart/form-data">
<table class="form" cellpadding=0 cellspacing=0>
	<tr>
		<td colspan=2 class="topTd"></td>
	</tr>
	<tr>
		<td class="item_title">{%MAIL_TYPE}:</td>
		<td class="item_input">
			<select name='mail_type'>
				<option value="0" <if condition="$vo['deal_id'] eq 0">selected="selected"</if>>{%COMMON_NOTICE}</option>
				<option value="1" <if condition="$vo['deal_id'] gt 0">selected="selected"</if>>{%DEAL_NOTICE}</option>
			</select>
			
			<span id="deal_id">
				<input type="text" class="textbox" name="deal_id" onblur="gen_deal_mail();"  value="{$vo.deal_id}" /> 
				<span class="tip_span">{%DEAL_ID_PROMOTE_TIP}</span>

			</span>
			<span id="is_html">
				{%IS_HTML}：
				<select name="is_html">
					<option value="0" <if condition="$vo['is_html'] eq 0">selected="selected"</if>>{%NO}</option>
					<option value="1" <if condition="$vo['is_html'] eq 1">selected="selected"</if>>{%YES}</option>
				</select>
			</span>
		</td>
	</tr>
	<tr>
		<td class="item_title">{%SEND_TIME}:</td>
		<td class="item_input">
			<input type="text" class="textbox require" name="send_time" id="send_time" value="{:to_date($vo['send_time'])}" onfocus="this.blur(); return showCalendar('send_time', '%Y-%m-%d %H:%M:%S', false, false, 'btn_send_time');" />
			<input type="button" class="button" id="btn_send_time" value="{%SELECT_TIME}" onclick="return showCalendar('send_time', '%Y-%m-%d %H:%M:%S', false, false, 'btn_send_time');" />	
			<input type="button" class="button" value="{%CLEAR_TIME}" onclick="$('#send_time').val('');" />	
			{%RESEND}：<input type="checkbox" value="1" name="resend" />
		</td>
	</tr>
	<tr id="mail_title">
		<td class="item_title">{%MAIL_TITLE}:</td>
		<td class="item_input"><input type="text" class="textbox" name="title" <if condition="$vo['deal_id'] eq 0">value="{$vo.title}"</if> /></td>
	</tr>
	<tr id="mail_content">
		<td class="item_title">{%MAIL_CONTENT}:</td>
		<td class="item_input">
			 <html:editor id="mail_content_editor" name="content" type="MAILEDITOR" content="{$vo.content}" />
		</td>
	</tr>
	<tr>
		<td class="item_title">{%SEND_TYPE}:</td>
		<td class="item_input">
			 <select name="send_type">
			 	<option value="0" <if condition="$vo['send_type'] eq 0">selected="selected"</if>>{%SEND_TYPE_0}</option>
				<option value="2" <if condition="$vo['send_type'] eq 2">selected="selected"</if>>{%SEND_TYPE_2}</option>
			 </select>
		</td>
	</tr>
	<tr id="city_id">
		<td class="item_title">{%SUBMIT_CITY}:</td>
		<td class="item_input">
		<select name="city_id">
			<option value="0" <if condition="$vo['send_type'] eq 1 and $vo['send_type_id'] eq 0">selected="selected"</if>>=={%ALL_CITY}==</option>
			<foreach name="city_list" item="city_item">
				<option value="{$city_item.id}" <if condition="$vo['send_type'] eq 1 and $vo['send_type_id'] eq $city_item['id']">selected="selected"</if>>{$city_item.title_show}</option>
			</foreach>
		</select>
		</td>
	</tr>
	<tr id="group_id">
		<td class="item_title">{%USER_GROUP}:</td>
		<td class="item_input">
			<select name="group_id">
				<option value="0" <if condition="$vo['send_type'] eq 0 and $vo['send_type_id'] eq 0">selected="selected"</if>>=={%ALL_USER_GROUP}==</option>
				<foreach name="group_list" item="group_item">
					<option value="{$group_item.id}" <if condition="$vo['send_type'] eq 0 and $vo['send_type_id'] eq $group_item['id']">selected="selected"</if>>{$group_item.name}</option>
				</foreach>
			</select>
		</td>
	</tr>
	<tr id="send_define_data">
		<td class="item_title">{%SEND_DEFINE_DATA}:</td>
		<td class="item_input">
			<textarea class="textarea" name="send_define_data" >{$vo.send_define_data}</textarea>
			<span class="tip_span">{%SEND_DEFINE_DATA_TIP}</span>
		</td>
	</tr>
	<tr>
		<td class="item_title"></td>
		<td class="item_input">
			<!--隐藏元素-->
			<input type="hidden" name="type" value="1" />
			<input type="hidden" name="id" value="{$vo.id}" />
			<input type="hidden" name="{:conf("VAR_MODULE")}" value="PromoteMsg" />
			<input type="hidden" name="{:conf("VAR_ACTION")}" value="update_mail" />
			<!--隐藏元素-->
			<input type="submit" class="button" value="{%EDIT}" />
			<if condition="app_conf('EDM_ON') eq 1">
			<input type="button" class="button" value="{%IMPORT_TO_EDM}" id="edm" />	
			</if>
			<input type="reset" class="button" value="{%RESET}" />
		</td>
	</tr>
	<tr>
		<td colspan=2 class="bottomTd"></td>
	</tr>
</table>	 
</form>
</div>
<include file="Public:footer" />